/*
 * AirPlane.h
 *
 *  Created on: 2012/07/08
 *      Author: weihe
 */

#ifndef AIRPLANE_H_
#define AIRPLANE_H_

#include "geom.h"
#include "glex.h"

namespace object {

class AirPlane {
	Camera *camera;
	static const float BASE_SPEED;
	float speed;
	float _aileron, _elevator, _rudder;
	bool stall;
public:
	AirPlane(Camera *camera) :
			camera(camera), _aileron(camera->bank()), _elevator(
					camera->pitch()), _rudder(camera->heading()), speed(
					BASE_SPEED),stall(false) {
	}
	virtual ~AirPlane();

	void update(float dt);

	void aileron(float rad);
	void elevator(float rad);
	void rudder(float rad);

	float calcSpeed();
};

} /* namespace object */
#endif /* AIRPLANE_H_ */
